extends Node2D


@export var slimeScene : PackedScene
@export var spawn_timer : Timer
@export var score : int = 0
@export var score_label : Label
@export var game_overr : Label


func _process(delta: float) -> void:
	spawn_timer.wait_time -= 0.2 * delta
	spawn_timer.wait_time = clamp(spawn_timer.wait_time,1,3)
	score_label.text = "Score: " + str(score)

func _on_timer_timeout() -> void:
	var slime = slimeScene.instantiate()
	var y = randf_range(65,106)
	slime.position = Vector2(264,y)
	get_tree().current_scene.add_child(slime)

func show_game_over():
	game_overr.visible = true
